package com.molichuxing.services.infrastructure.service;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.infrastructure.dto.response.request.create.LoginLogCreateDto;
import com.molichuxing.services.infrastructure.dto.response.response.LoginLogDto;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 系统操作日志表 服务类
 * </p>
 *
 * @author xuelin yi
 * @since 2019-09-20
 */
public interface LoginLogService extends RootService {

    /**
     * 根据经销商id获取操作日志记录
     * @param map
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Paged<LoginLogDto> getLoginLogByDealerId(Map<String, Object> map, Integer pageNum, Integer pageSize);

    /**
     * 创建登录（登出）日志
     *
     * @param dto
     * @return
     */
    @Deprecated
    public int createLoginLog(LoginLogDto dto);

    /**
     * 新增登录（登出）日志
     *
     * @param createDto
     * @return
     */
    public Boolean create(LoginLogCreateDto createDto);

    /**
     * 获取用户最后一次登录时间
     *
     * @return
     */
    LoginLogDto getAccountByLastLoginTime(int accountId, int type);

    List<LoginLogDto> getLogByAccountAndType(String account, Integer type);

    int updateAccountLogOutTime(String account);

    /**
     * 获取登录日志信息
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Paged<LoginLogDto> getLoginLog(Map<String, Object> params, Integer pageNum, Integer pageSize);
}
